package com.aiit.service.impl;

import com.aiit.mapper.PostMapper;
import com.aiit.pojo.Post;
import com.aiit.pojo.User;
import com.aiit.service.PostService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * Created with IntelliJ IDEA.
 *
 * @Author: LuTao
 * @Date: 2022/04/29/21:42
 */
@Service
public class PostServiceImpl extends ServiceImpl<PostMapper, Post> implements PostService {
    @Autowired
    private PostMapper postMapper;

/*    @Override
    public List<User> findPostByUserId(User user) {
        return postMapper.findPostByUserId(user);
    }*/

    @Override
    public int posts(Post post) {
        return postMapper.posts(post);
    }

    //    @Override
//    public Post findPostByUserId(Integer id,String post,String username) {
//        return postMapper.findPostByUserId(id,post,username);
//    }
    @Override
    public Post findPostByUserId(Integer id) {
        return postMapper.findPostByUserId(id);
    }

    @Override
    public List<Post> PostAll() {
        return postMapper.PostAll();
    }
}
